package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.sql.Blob;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author demo
 * @since 2025-02-24
 */
public class Knowledge implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 内容标题
     */
    private String title;

    /**
     * 发布者账号
     */
    private String publisherNo;

    /**
     * 知识类别
     */
    private String type;

    /**
     * 内容
     */
    private String content;

    /**
     * 配图
     */

    @TableField("image_bytes")
    @JsonIgnore
    private byte[] imageBytes;
    @TableField("image_type")
    private String imageType;

    private LocalDateTime createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public String getPublisherNo() {
        return publisherNo;
    }

    public void setPublisherNo(String publisherNo) {
        this.publisherNo = publisherNo;
    }
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
    public byte[] getImageBytes(){
        return imageBytes;
    }
    public void setImageBytes(byte[] imageBytes) {
        this.imageBytes = imageBytes;
    }

    public String getImageType(){
        return imageType;
    }
    public void setImageType(String imageType) {
        this.imageType = imageType;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }
    public void setCreateTime (LocalDateTime createTime) {
        this.createTime = createTime;
    }



    @Override
    public String toString() {
        return "Knowledge{" +
            "id=" + id +
            ", title=" + title +
            ", publisherNo=" + publisherNo +
            ", type=" + type +
            ", content=" + content +
            ", imageBytes=" + imageBytes +
            ", imageType=" + imageType +
            ", createTime=" + createTime +
        "}";
    }
}
